<template>
  <div class="box">
    <div class="searchBox">
      <el-select
        v-model="value"
        class="m-2"
        placeholder="Select"
        size="default"
        style="width: 160px; margin-right: 10px"
      >
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        />
      </el-select>
      <el-input
        v-model="input2"
        class="w-50 m-2"
        placeholder="搜索关键词"
        :prefix-icon="Search"
        style="width: 160px; margin-right: 10px"
      />
      <el-button type="primary">查询</el-button>
      <el-button @click="addCoach">添加教练</el-button>
    </div>
    <div class="tableBox">
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="date" label="姓名" />
        <el-table-column prop="name" label="性别" width="80" />
        <el-table-column prop="name" label="电话" width="180" />
        <el-table-column prop="address" label="所属场馆" width="180" />
        <el-table-column prop="name" label="排序" width="180" />
        <el-table-column prop="name" label="状态" />
        <el-table-column prop="name" label="操作" width="180">
          <el-link type="primary" style="margin-right: 15px" @click="toView"
            >查看</el-link
          >
          <el-link type="primary" style="margin-right: 15px" @click="FnEditor"
            >编辑
          </el-link>
          <el-link type="primary" @click="open">删除</el-link>
        </el-table-column>
      </el-table>

      <div class="pageBox">
        <el-pagination layout="prev, pager, next" :total="100" />
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import router from "../../router";

import { Calendar, Search } from "@element-plus/icons-vue";
import { ElMessage, ElMessageBox } from "element-plus";
const value = ref("");
const input2 = ref("");
const addCoach: any = function () {
  router.push("/mainView/ListCoaches/listcoachesFour");
};
const FnEditor: any = function () {
  router.push("/mainView/ListCoaches/listcoachesThree");
};
const toView: any = function () {
  router.push("/mainView/ListCoaches/listcoachesTwo");
};
const open = () => {
  ElMessageBox.confirm("确定要删除吗?删除后无法恢复", "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(() => {
      ElMessage({
        type: "success",
        message: "删除成功",
      });
    })
    .catch(() => {
      ElMessage({
        type: "info",
        message: "删除失败",
      });
    });
};
const tableData = [
  {
    date: "2016-05-03",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-02",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-04",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-01",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
];
const options = [
  {
    value: "Option1",
    label: "Option1",
  },
  {
    value: "Option2",
    label: "Option2",
  },
  {
    value: "Option3",
    label: "Option3",
  },
  {
    value: "Option4",
    label: "Option4",
  },
  {
    value: "Option5",
    label: "Option5",
  },
];
</script>

<style scoped>
.box {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px 25px;
  background-color: #fff;
  box-sizing: border-box;
}
.searchBox {
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.tableBox {
  width: 100%;
}
.pageBox {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 20px;
}
</style>
